<%@ page language="java" pageEncoding="utf8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />
	</head>
	<body style="">
		<div id="headBar" class="head_content"></div>
		<div id="main" class="main_content">
			<form method="post" id="model_form" action="od_center_save.html" class="tableform">
				<input type="hidden" value="${orderDeliveryCenter.deliveryCenterId}" name="orderDeliveryCenter.deliveryCenterId" />
					<h4>
						添加发货地址信息
					</h4>
					<div class="division">
						<table cellspacing="0" cellpadding="0" border="0">
							<tbody>
								<tr>
									<td>
										<table cellspacing="0" cellpadding="0" border="0">
											<tbody>
												<tr>
													<th>
														发货点名称：
													</th>
													<td colspan="3">
														<input  class="item itemrow _x_ipt" style="width: 145px;"  value="${orderDeliveryCenter.centerName }" name="orderDeliveryCenter.centerName" />
													</td>
												</tr>
												<tr>
													<th>
														发货人姓名：
													</th>
													<td>
														<input class="item itemrow _x_ipt" style="width: 80px;"  value="${orderDeliveryCenter.centerUname}" name="orderDeliveryCenter.centerUname">
													</td>
													<th>
														性别：
													</th>
													<td>
														<select style="width: 80px;" id="orderDeliveryCenter_centerSex"  name="orderDeliveryCenter.centerSex">
															<option value="true">男</option>
															<option value="false">女</option>
														</select>
													</td>
												</tr>
												<tr>
													<th>
														地区：
													</th>
													<td>
														<input  class="item itemrow _x_ipt"  style="width: 400px;" value="${orderDeliveryCenter.centerRegion }" 
														name="orderDeliveryCenter.centerRegion" />
													</td>
													<th>
														邮编：
													</th>
													<td>
														<input  class="item itemrow _x_ipt"
															value="${orderDeliveryCenter.centerZip }" name="orderDeliveryCenter.centerZip"  style="width: 90px;"/>
													</td>
												</tr>
												<tr>
													<th>
														地址：
													</th>
													<td colspan="3">
														<input  class="item itemrow _x_ipt" style="width: 400px;"
															 value="${orderDeliveryCenter.centerAddress }" name="orderDeliveryCenter.centerAddress" />
													</td>
												</tr>
												<tr>
													<th>
														手机：
													</th>
													<td>
														<input   class="item itemrow _x_ipt"
															style="width: 145px;" value="${orderDeliveryCenter.centerCellphone }"
															name="orderDeliveryCenter.centerCellphone"  >
													</td>
													<th>
														电话：
													</th>
													<td>
														<input  class="item itemrow _x_ipt" size="36"
															style="width: 145px;" value="${orderDeliveryCenter.centerPhone }" name="orderDeliveryCenter.centerPhone" />
													</td>
												</tr>
												<tr>
													<th>
														&nbsp;
													</th>
													<td colspan="3">
														<input type="checkbox"  <c:if test="${orderDeliveryCenter.defaultFlag}">checked="checked"</c:if> 
														 value="true"	name="orderDeliveryCenter.defaultFlag" />
															<label for="is_default_dc">
																设置为默认地址
															</label>
													</td>
												</tr>
												<tr>
													<th>
														备注：
													</th>
													<td colspan="3">
														<textarea rows="5" cols="45" style="width: 395px;"
															name="orderDeliveryCenter.centerDescription">${orderDeliveryCenter.centerDescription}</textarea>
													</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="table-action">
						<button class="btn" name="butsubmit" type="submit">
							<span><span>提交</span>
							</span>
						</button>
					</div>
			</form>
		</div>
		<div id="footBar" class="foot_content"></div>



 		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery.validate.js'/>"></script>
		<script type="text/javascript">
	
<c:if test="${ not empty orderDeliveryCenter.deliveryCenterId}">
	$('#orderDeliveryCenter_centerSex').attr('value', '${orderDeliveryCenter.centerSex}');
</c:if>
	$(document).ready(function() {
		var validator = $("#model_form").validate( {
			errorElement : "div",
			errorClass : "x-vali-error",
			onfocusout : false,
			rules : {
				'orderDeliveryCenter.centerName' : "required",
				'orderDeliveryCenter.centerAddress' : "required",
				'orderDeliveryCenter.centerRegion' : "required",
				'orderDeliveryCenter.centerUname' : "required",
				'orderDeliveryCenter.centerDescription' : "required",
				 
				'orderDeliveryCenter.centerZip' : {
					required : true 
				},
				'orderDeliveryCenter.centerPhone' : {
					required : true 
				},
				'orderDeliveryCenter.centerCellphone' : {
					required : true,
					number : true
				}
				 
			},
			messages : {
				'orderDeliveryCenter.centerName' : "必填字段",
				'orderDeliveryCenter.centerAddress' : "必填字段",
				'orderDeliveryCenter.centerRegion' : "必填字段",
				'orderDeliveryCenter.centerUname' : "必填字段",
				'orderDeliveryCenter.centerDescription' : "必填字段",
				'orderDeliveryCenter.centerZip' : {
					required : "必填字段"
				},
				'orderDeliveryCenter.centerPhone' : {
					required : "必填字段"
				},
				'orderDeliveryCenter.centerCellphone' : {
					required : "必填字段",
					number : "请输入数字"
				}
				 
			},
			errorPlacement : function(error, element) {
				element.removeClass('x-vali-error');
				error.appendTo(element.parent());

			},

			success : function(div) {
				$(div).remove();
			}
		});
	});
</script>
	</body>
</html>